package com.tiantian.homework_5_login.controller;


import com.tiantian.homework_5_login.pojo.Result;
import com.tiantian.homework_5_login.pojo.User;
import com.tiantian.homework_5_login.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/users")
@CrossOrigin
public class LoginController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public Result login(@RequestBody User user){
        return  userService.login(user);
    }
}
